package Main.Controller;

import Main.Service.UserService;
import Main.entity.UserAdvice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/save")
    @ResponseBody
    public boolean save(String content, String contact) {
        UserAdvice user = new UserAdvice();
        user.setMsg(content);
        user.setPhoneNum(contact);
        int result = this.userService.insert(user);
        System.out.println(result);
        return true;
    }
}
